#include "bsp_lcd.h"

#include <spi.h>

#include "bsp_font.h"
void Bsp_IpsWrCmd(uint8_t dat) {
  IPS114_CS(0);
  IPS114_DC(0);
  HAL_SPI_Transmit(&hspi2, &dat, 1, 500);
  IPS114_CS(1);
}

void Bsp_IpsWrData(uint8_t dat) {
  IPS114_CS(0);
  IPS114_DC(1);
  HAL_SPI_Transmit(&hspi2, &dat, 1, 500);
  IPS114_CS(1);
}

void Bsp_IpsWrData16(uint16_t dat) {
  uint8_t h, l;
  h = dat >> 8;
  l = (uint8_t)dat;
  IPS114_CS(0);
  IPS114_DC(1);
  HAL_SPI_Transmit(&hspi2, &h, 1, 500);
  HAL_SPI_Transmit(&hspi2, &l, 1, 500);
  IPS114_CS(1);
}
